﻿using DFGK_WMS.Model.DTO;
using DFGK_WMS.Model.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DFGK_WMS.IRepository
{
    public interface IMenuitemRepository:IBaseRepository<TMenu>
    {
        /// <summary>
        /// 根据用户Id获取对应权限
        /// </summary>
        /// <param name="uid"></param>
        /// <returns></returns>
        List<UserRoleMenuAction> GetMenuitemAction(int uid);

       /// <summary>
       /// 获取菜单列表
       /// </summary>
       /// <param name="mname"></param>
       /// <param name="status"></param>
       /// <returns></returns>
        List<MenuDto> GetMenuList(string mname,int status);

        /// <summary>
        /// 左侧穿梭框显示
        /// </summary>
        /// <param name="mid"></param>
        /// <returns></returns>
        List<TAction> GetLeftMenuActionList(int mid);

        /// <summary>
        /// 右侧穿梭框显示
        /// </summary>
        /// <param name="mid"></param>
        /// <returns></returns>
        List<TAction> GetRightMenuActionList(int mid);

        /// <summary>
        /// 添加菜单操作关系
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        bool AddMenuAction(TMenuAction m);

        /// <summary>
        /// 删除菜单
        /// </summary>
        /// <param name="mid"></param>
        /// <returns></returns>
        bool DelMenuItem(int mid);

        /// <summary>
        /// 添加菜单
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        bool AddMenuItem(TMenu m);

        /// <summary>
        /// 修改菜单
        /// </summary>
        /// <param name="M"></param>
        /// <returns></returns>
        bool UpdMenuItem(TMenu m);

        /// <summary>
        /// 加载分配权限列表
        /// </summary>
        /// <returns></returns>
        List<MenuRoleMenuActionDto> GetMenuActionList(int rid);

        /// <summary>
        /// 分配权限
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        bool AddRoleMenuAction(CRoleMenuAction m);


        /// <summary>
        /// 根据ID获取详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        TMenu GetMenuItem(int id);
        /// <summary>
        /// 修改权限为隐藏
        /// </summary>
        /// <param name="idList"></param>
        /// <param name="errorMsg"></param>
        /// <returns></returns>
        bool UpdMenuHide(int[] idList, out string errorMsg);
    }
}
